#include <stdio.h>

typedef struct bits_t{
  unsigned b0 : 1;
  unsigned b1 : 1;
  unsigned b2 : 1;
  unsigned b3 : 1;
  unsigned b4 : 1;
  unsigned b5 : 1;
  unsigned b6 : 1;
  unsigned b7 : 1;
}bits;

typedef union bits_u{
  char val;
  bits bit;
}byte;

main(){
  byte actual;

  actual.val = 13;

  printf("%d %d %d %d %d %d %d %d\n", actual.bit.b7, actual.bit.b6,
	 actual.bit.b5, actual.bit.b4, actual.bit.b3, actual.bit.b2,
	 actual.bit.b1, actual.bit.b0);
  
  /* I a la inversa: */

  actual.val = 0;
  actual.bit.b4 = 1;
  actual.bit.b1 = 1;
  printf("%d\n", actual.val);

}
